import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
import infiniteScroll from 'vue-infinite-scroll'
import Bridge from '@/components/dsbridge.js'

Vue.prototype.$dsbridge = Bridge
Vue.use(infiniteScroll)

// Vue.prototype.$url='http://192.168.10.33:18090'//本地测试地址
Vue.prototype.$url='https://api.582btc.com'//生产地址
Vue.config.productionTip = false
Vue.prototype.$axios = axios.create({
  // 去掉域名前缀
  baseURL: 'https://api.582btc.com',
  // baseURL: 'http://192.168.10.33:18090',
  // 其他配置...
});
// Vue.prototype.$token = localStorage.getItem("token");




Vue.prototype.$axios.interceptors.request.use(function (config) {
  // 在发送请求之前做些什么
  // config.headers.Authorization = '+PQddp7K9/npTSwpE4/SqACwvNg3YRjGRKaTycLgoE/Knh0y0qois5XlZXMfWEG+usaIgPwdioZs+covHubrYKlr+qe+xYa6WHRvPNC0V2U='
  config.headers.Authorization = localStorage.getItem("token")
  return config;
}, function (error) {
  // 对请求错误做些什么
  console.log(error)
  // config.headers.Authorization = localStorage.getItem("token")
  // return Promise.reject(error);
});

new Vue({
  router,
  store,
  render: function (h) { return h(App) }
}).$mount('#app')
